package com.eas.ereceipt.util;

import java.util.ArrayList;

import android.content.Context;

import com.eas.ereceipt.R;
import com.eas.ereceipt.bean.GroupSlidingMenu;
import com.eas.ereceipt.bean.ItemSlidingMenu;

public class SlidingMenuConfig {
	
	public static final int GROUP_RECEIPT = 0;
	public static final int ITEM_BUSINESS = 101;
	public static final int ITEM_YOUR_RECEIPTS = 102;
	public static final int GROUP_SETTING = 1;
	public static final int ITEM_SETTING = 103;
	public static final int ITEM_ABOUT = 104;
	public static final int ITEM_SIGN_OUT = 105;

	private static ArrayList<GroupSlidingMenu> groups;
	
	public static void init(Context c){
		if (groups == null) groups = new ArrayList<GroupSlidingMenu>();
		//receipt
		GroupSlidingMenu receipt = new GroupSlidingMenu();
		receipt.setId(GROUP_RECEIPT);
		receipt.setTitle(c.getString(R.string.group_receipt_title));
		ArrayList<ItemSlidingMenu> its = new ArrayList<ItemSlidingMenu>();
		ItemSlidingMenu i; 
		
		/*i= new ItemSlidingMenu();
		i.setId(ITEM_BUSINESS);
		i.setTitle(c.getString(R.string.item_business_title));
		i.setIconResID(R.drawable.ic_business);
		its.add(i);*/
		
		i = new ItemSlidingMenu();
		i.setId(ITEM_YOUR_RECEIPTS);
		i.setTitle(c.getString(R.string.item_your_receipt_title));
		i.setIconResID(R.drawable.ic_personal);
		its.add(i);
		
		receipt.setItems(its);
		
		groups.add(receipt);
		
		//setting
		GroupSlidingMenu setting = new GroupSlidingMenu();
		setting.setId(GROUP_SETTING);
		setting.setTitle(c.getString(R.string.group_setting_title));
		ArrayList<ItemSlidingMenu> sts = new ArrayList<ItemSlidingMenu>();
		ItemSlidingMenu s; 
		
		s= new ItemSlidingMenu();
		s.setId(ITEM_SETTING);
		s.setTitle(c.getString(R.string.item_setting_title));
		s.setIconResID(R.drawable.ic_setting);
		sts.add(s);
		
		s = new ItemSlidingMenu();
		s.setId(ITEM_ABOUT);
		s.setTitle(c.getString(R.string.item_about_title));
		s.setIconResID(R.drawable.ic_about);
		sts.add(s);
		
		s = new ItemSlidingMenu();
		s.setId(ITEM_SIGN_OUT);
		s.setTitle(c.getString(R.string.item_sign_out_title));
		s.setIconResID(R.drawable.ic_sign_out);
		sts.add(s);
		
		setting.setItems(sts);
		
		groups.add(setting);
	}

	public static ArrayList<GroupSlidingMenu> getGroups() {
		return groups;
	}

	

}
